package com.xwtec.singleton;

/**
 * @Author: zt
 * @Date: 2021/2/21 10:50
 *
 * 跟01是一个意思
 */
public class Mgr02 {
    private final static Mgr02 INSTANCE ;
    static {
        INSTANCE = new Mgr02();
    }
    //私有构造方法
    private Mgr02(){};

    public static Mgr02 getInstacne(){
        return INSTANCE;
    }
    public void m(){
        System.out.println("m");
    }

    public static void main(String[] args) {
        Mgr02 m1 = Mgr02.getInstacne();
        Mgr02 m2 = Mgr02.getInstacne();
        System.out.println(m1==m2);

    }
}
